-- GENERATED SPELL FOR [Phantasmal Cloudscraper] --


function spell0_27645(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(59220,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27645', 3000, 1)
end

function spell1_27645(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(59223,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27645', 3000, 1)
end

function spell2_27645(pUnit, Event) --@Thunderclap,Self--
pUnit:FullCastSpellOnTarget(15588,pUnit)
pUnit:RegisterEvent('Sorts_27645', 10350, 1)
end

function spell3_27645(pUnit, Event) --@Thunderclap,Self--
pUnit:FullCastSpellOnTarget(59217,pUnit)
pUnit:RegisterEvent('Sorts_27645', 10300, 1)
end

function Sorts_27645(pUnit, Event)
local choix_sorts_27645 = math.random(0, 3)
if choix_sorts_27645 == 0 then
pUnit:RegisterEvent('spell0_27645', 1, 1)
end
if choix_sorts_27645 == 1 then
pUnit:RegisterEvent('spell1_27645', 1, 1)
end
if choix_sorts_27645 == 2 then
pUnit:RegisterEvent('spell2_27645', 1, 1)
end
if choix_sorts_27645 == 3 then
pUnit:RegisterEvent('spell3_27645', 1, 1)
end
end

function mob27645_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27645', math.random(1500, 3000), 1)
end

function mob27645_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27645_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27645_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27645, 1, 'mob27645_Action')
RegisterUnitEvent(27645, 2, 'mob27645_Leave')
RegisterUnitEvent(27645, 3, 'mob27645_Kill')
RegisterUnitEvent(27645, 4, 'mob27645_Die')
